package org.annoflow.audit;

public  class ContextTracker {
	private static ContextTracker tracker = new ContextTracker();
//	private ThreadLocal<String> callerContext = new ThreadLocal<String>();
	private ThreadLocal<Class<?>> filterContext = new ThreadLocal<Class<?>>();
	private ThreadLocal<String> callerContext = new ThreadLocal<String>();

	private ContextTracker()
	{
		callerContext.set(null);
		filterContext.set(null);
	}
	public static ContextTracker getInstance()
	{
		return tracker;
	}
	public void setFilterContext(Class<?> caller)
	{
		filterContext.set(caller);
	}
	public Class<?> getFilterContext()
	{
		return filterContext.get();
	}
	public String getCallerContext()
	{
		return callerContext.get();
	}
	public void setCallerContext(String caller)
	{
		callerContext.set(caller);
	}
	public void clear()
	{
		filterContext.set(null);
		callerContext.set(null);
	}
}
